package com.youshang520i.nacosserviceconsume.service;

import com.youshang520i.nacosserviceconsume.service.fallback.ConsumeServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author youshang
 * 测试fallbackFactory 降级 ,只有当 nacos-service-provider 服务掉不通的时候才会执行 fallbackFactory 对应的降级
 */
@RestController
@FeignClient(value = "nacos-service-provider",fallbackFactory = ConsumeServiceFallbackFactory.class)
public interface ConsumeService {

    @GetMapping("/index/{str}")
    String index(@PathVariable("str") String str);
}
